package xian.woniuxy.y_override_overload;

class Shape {

}

class Rect extends Shape {

}

class Triangle extends  Shape {

}

class Foo {
   void f1(Rect r) {
       System.out.println("矩形");
   }
    void f1(Triangle t) {
        System.out.println("三角形");
    }
    void f1(Shape s) {
        System.out.println("图形");
    }
}

public class App {
    public static void main(String[] args) throws Exception {
        Foo foo = new Foo();

        Shape s= new Rect();
        foo.f1(s);
    }
}
